# coding: utf-8

import six

from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization


class Malware:

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    sensitive_list = []

    openapi_types = {
        'name': 'str',
        'sha256': 'str',
        'type': 'str',
        'path': 'str',
        'state': 'str',
        'properties': 'MalwareProperties'
    }

    attribute_map = {
        'name': 'name',
        'sha256': 'sha256',
        'type': 'type',
        'path': 'path',
        'state': 'state',
        'properties': 'properties'
    }

    def __init__(self, name=None, sha256=None, type=None, path=None, state=None, properties=None):
        """Malware

        The model defined in huaweicloud sdk

        :param name: 恶意软件名称，最大64个字符。
        :type name: str
        :param sha256: 恶意软件sha256
        :type sha256: str
        :param type: 恶意软件类型，遵循STIX规范： adware、backdoor、bot、bootkit、ddos、downloader、dropper、exploit-kit、keylogger、ransomware、remote-access-trojan、resource-exploitation、rogue-security-software、rootkit、screen-capture、spyware、trojan、unknown、virus、webshell、wiper、worm
        :type type: str
        :param path: 恶意软件在系统中的路径，最大512个字符。
        :type path: str
        :param state: 恶意软件状态，取值范围：OBSERVED、REMOVAL_FAILED、REMOVED。
        :type state: str
        :param properties: 
        :type properties: :class:`huaweicloudsdksa.v1.MalwareProperties`
        """
        
        

        self._name = None
        self._sha256 = None
        self._type = None
        self._path = None
        self._state = None
        self._properties = None
        self.discriminator = None

        self.name = name
        if sha256 is not None:
            self.sha256 = sha256
        self.type = type
        if path is not None:
            self.path = path
        if state is not None:
            self.state = state
        if properties is not None:
            self.properties = properties

    @property
    def name(self):
        """Gets the name of this Malware.

        恶意软件名称，最大64个字符。

        :return: The name of this Malware.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Malware.

        恶意软件名称，最大64个字符。

        :param name: The name of this Malware.
        :type name: str
        """
        self._name = name

    @property
    def sha256(self):
        """Gets the sha256 of this Malware.

        恶意软件sha256

        :return: The sha256 of this Malware.
        :rtype: str
        """
        return self._sha256

    @sha256.setter
    def sha256(self, sha256):
        """Sets the sha256 of this Malware.

        恶意软件sha256

        :param sha256: The sha256 of this Malware.
        :type sha256: str
        """
        self._sha256 = sha256

    @property
    def type(self):
        """Gets the type of this Malware.

        恶意软件类型，遵循STIX规范： adware、backdoor、bot、bootkit、ddos、downloader、dropper、exploit-kit、keylogger、ransomware、remote-access-trojan、resource-exploitation、rogue-security-software、rootkit、screen-capture、spyware、trojan、unknown、virus、webshell、wiper、worm

        :return: The type of this Malware.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this Malware.

        恶意软件类型，遵循STIX规范： adware、backdoor、bot、bootkit、ddos、downloader、dropper、exploit-kit、keylogger、ransomware、remote-access-trojan、resource-exploitation、rogue-security-software、rootkit、screen-capture、spyware、trojan、unknown、virus、webshell、wiper、worm

        :param type: The type of this Malware.
        :type type: str
        """
        self._type = type

    @property
    def path(self):
        """Gets the path of this Malware.

        恶意软件在系统中的路径，最大512个字符。

        :return: The path of this Malware.
        :rtype: str
        """
        return self._path

    @path.setter
    def path(self, path):
        """Sets the path of this Malware.

        恶意软件在系统中的路径，最大512个字符。

        :param path: The path of this Malware.
        :type path: str
        """
        self._path = path

    @property
    def state(self):
        """Gets the state of this Malware.

        恶意软件状态，取值范围：OBSERVED、REMOVAL_FAILED、REMOVED。

        :return: The state of this Malware.
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this Malware.

        恶意软件状态，取值范围：OBSERVED、REMOVAL_FAILED、REMOVED。

        :param state: The state of this Malware.
        :type state: str
        """
        self._state = state

    @property
    def properties(self):
        """Gets the properties of this Malware.

        :return: The properties of this Malware.
        :rtype: :class:`huaweicloudsdksa.v1.MalwareProperties`
        """
        return self._properties

    @properties.setter
    def properties(self, properties):
        """Sets the properties of this Malware.

        :param properties: The properties of this Malware.
        :type properties: :class:`huaweicloudsdksa.v1.MalwareProperties`
        """
        self._properties = properties

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                if attr in self.sensitive_list:
                    result[attr] = "****"
                else:
                    result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        import simplejson as json
        if six.PY2:
            import sys
            reload(sys)
            sys.setdefaultencoding("utf-8")
        return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)

    def __repr__(self):
        """For `print`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, Malware):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
